<template>
  <mobile-navigation-vue v-if="isMobileTerminal" :data="blogs" />
</template>

<script setup>
import { isMobileTerminal } from '../../../../utils/flexible'
import mobileNavigationVue from './mobile/index.vue'
import { getCategory } from '@/api/category.js'
import request from '@/utils/request.js'
import { onMounted, ref } from 'vue'
import { ALL_CATEGORY_ITEM } from '../../../../constants'

//获取数据
const blogs = ref([])
const getData = async () => {
  // const { blogs } = await request({
  let res = await request({
    url: '/article/findAll',
    method: 'GET'
  })
  console.log('res:', res)
  blogs.value = res.article
  blogs.value.unshift(ALL_CATEGORY_ITEM)
  console.log(blogs.value)
  console.log(blogs)
}
onMounted(() => {
  getData()
})
</script>
